import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	const _id = get(fd, '_id');
	const post_package = get(fd, 'post_package');
	const flag = get(fd, 'flag');
	console.log(flag)
	if (flag === 1) {
		const res = await nodejs<{ code: 1 | 0 }>('GuoKai/zj-000006/s001', {
			_id: _id,
			post_package: post_package
		});
		if (res.code === 0) {
			alert("删除失败");
		} else {
			alert("删除成功");
			refresh();
		}
	}
	else if (flag === 0) {
		const res = await nodejs<{ code: 1 | 0 }>('GuoKai/zj-000006/s002', {
			_id: _id,

		});
		if (res.code === 0) {
			alert("删除失败");
		} else {
			alert("删除成功");
			refresh();
		}
	}

}
